//
//  MessageServicer.m
//  NursingAssociation
//
//  Created by wsj2015 on 2017/3/7.
//  Copyright © 2017年 wsj2015. All rights reserved.
//

#import "MessageServicer.h"

static MessageServicer *ms = nil;


@implementation MessageServicer

+ (instancetype)shareServicer
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        ms = [[MessageServicer alloc] init];
    });
    return ms;

}



//- (void)setMessage:(HELMessageModel *)message{
//    
//    if (_message) {
//        if ([_message.unread integerValue]!=[message.unread integerValue]) {
//            if (self.messageChangedBlock) {
//                self.messageChangedBlock([message.unread integerValue]);
//            }
//        }
//    }
//    _message = message;
//
//}


- (void)requestPersonInfoWithSucess:(void(^)(NSInteger))sucess{
   
    NSMutableDictionary *params =[NSMutableDictionary dictionary];
    

    [[HELNetworkManager sharedMg] GET:helGetNotReadMessage parameters:params success:^(id responseObject) {
        
     NSNumber *unread = responseObject[@"data"];
        if (sucess) {
            if (unread) {
                 sucess([unread integerValue]);
            }else{
                sucess(0);
            }
           
        }
    } failure:^(NSString *err) {
        
    }];

}



@end
